   1 . 
   2 .
   3 .
   4 .
   5 .MASTERMIND
   6 .BY BOB WISEMAN
  10 :return ;NT=1;clear 
  20 BC=6;FC=0
 100 print ;print "THE GAME OF MASTERMIND";print 
 110 print "COLOR CODES:"
 120 R=1200;gosub R;print "R=RED     G=GREEN"
 140 gosub R;print "O=ORANGE  B=BLUE"
 150 gosub R;print "Y=YELLOW  P=PURPLE"
 180 M=0
 190 for N=1to 4;@(N)=rnd (6);next N
 192 print "YOUR MOVE"
 195 M=M+1
 196 if M=10goto 1000
 220 for N=4mul M+1to 4mul M+4
 240 G=KP;TV=G
 245 if G=81goto 1000
 250 if G=89BC=126;@(N)=1;goto 400
 260 if G=82BC=98;@(N)=2;goto 400
 270 if G=71BC=156;@(N)=3;goto 400
 280 if G=80BC=43;@(N)=4;goto 400
 290 if G=79BC=110;@(N)=5;goto 400
 300 if G=66BC=249;@(N)=6;goto 400
 310 TV=31;TV=63;TV=31;goto 240
 400 next N
 410 B=0;W=0
 420 for Z=1to 4
 421 P=Mmul 4+Z
 423 if @(P)=@(Z)B=B+1;@(P)=@(P)+14;@(Z)=@(Z)+7
 425 next Z
 426 for Z=1to 4;P=Mmul 4+Z
 430 for N=1to 4
 435 if Z=Ngoto 470
 440 if @(N)#@(P)goto 470
 450 @(P)=@(P)+14
 455 @(N)=@(N)+7
 460 W=W+1;goto 500
 470 next N
 500 next Z
 502 for N=1to 4;if @(N)>6@(N)=@(N)-7
 504 next N
 510 print #4,B," BLACK",#2,W," WHITE
 522 Z=10mul B+W;NT=0
 524 for N=-Zto 1step -1
 525 &(22)=-32700
 526 &(16)=Nmul 2;next N
 528 &(16)=0;NT=1
 530 if B<4goto 195
 900 print "YOU WIN"
 910 NT=0;for Z=400to 1step -4
 915 &(22)=-32760
 920 &(16)=Z;&(17)=Zdiv 2
 930 next Z;NT=1
 935 &(22)=0;&(16)=0;&(17)=0
 940 A=KP;goto 10
1000 print "TOO MANY TRIES
1002 for Z=1to 400step 4
1004 &(22)=-32760
1006 &(16)=Z;&(17)=Zdiv 2;&(18)=Zdiv 10
1008 next Z
1009 &(16)=0;@(22)=0;&(17)=0;&(18)=0;NT=1
1010 print "THE CODE WAS:"
1020 for N=1to 4
1030 Z=@(N)
1040 if Z=1print "YELLOW ",
1050 if Z=2print "RED ",
1060 if Z=3print "GREEN ",
1070 if Z=4print "PURPLE ",
1080 if Z=5print "ORANGE ",
1090 if Z=6print "BLUE ",
1095 next N;A=KP;goto 10
1200 CX=-50;return 
:return ;run 
